var startdrag = 0;
var stopsave = 0;
function bindEven() {
	// 布局的拖拽
	$(".ele-row").draggable({
		connectToSortable: ".ele-col",
		helper: "clone",
		handle: ".ele-drag-btn",
		start: function(e, t) {
			if(!startdrag) stopsave++;
			startdrag = 1;
		},
		drag: function(e, t) {
			t.helper.width(400)
		},
		stop: function(e, t) {
			$(".ele-col").sortable({
				opacity: .35,
				connectWith: ".ele-col",
				start: function(e, t) {
					if(!startdrag) stopsave++;
					startdrag = 1;
				},
				stop: function(e, t) {
					if(stopsave > 0) stopsave--;
					startdrag = 0;
				}
			});
			if(stopsave > 0) stopsave--;
			startdrag = 0;
		}
	});
	
	// 基本元素
	$(".ele-box").draggable({
		connectToSortable: ".editor-content .ele-row .ele-col",
		helper: "clone",
		handle: ".ele-drag-btn",
		start: function(e, t) {
			if(!startdrag) stopsave++;
			startdrag = 1;
		},
		drag: function(e, t) {
			t.helper.width(400)
		},
		stop: function(e, t) {
			if(stopsave > 0) stopsave--;
			startdrag = 0;
		}
	});

	$(".ele-col").sortable({
		connectWith: ".ele-col",
		opacity: .35,
		handle: ".ele-drag-btn",

		start: function(e, t) {
			if(!startdrag) stopsave++;
			startdrag = 1;
		},
		stop: function(e, t) {
			if(stopsave > 0) stopsave--;
			startdrag = 0;
		}
	});

}